<template>
	<view class="process">
		<headassy title="出库审核" :isTab="false" :isSearch="false"></headassy>
		<view class="process-content">
			<view class="form">
				<view class="title text-orange">
					出库信息
				</view>
				<u--form labelPosition="left" ref="uForm">
					<u-form-item label="出库类型" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right" @click="show=true"></u-icon>
					</u-form-item>
					<u-form-item label="出库仓库" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"  @click="show2=true"></u-icon>
					</u-form-item>
					<u-form-item label="出库单号" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none"></u--input>
		
					</u-form-item>
					<u-form-item label="制单人员" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"></u-icon>
					</u-form-item>
					<u-form-item label="审核人员" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"></u-icon>
					</u-form-item>
					<u-form-item label="预计出库" borderBottom ref="item1" labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"></u-icon>
					</u-form-item>
					<u-form-item label="出库网点" borderBottom labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"></u-icon>
					</u-form-item>
					<u-form-item label="出库单据" borderBottom labelWidth="200rpx">
						<u--input border="none" disabledColor="#ffffff" disabled></u--input>
						<u-icon slot="right" name="arrow-right"></u-icon>
					</u-form-item>
				</u--form>
			</view>
			<view class="form">
				<view class="title text-orange">
					出库清单
				</view>
				<view class="">
					<uni-table border stripe emptyText="暂无更多数据" >
						<!-- 表头行 -->
						<uni-tr>
							<uni-th align="center">商品/备件名称</uni-th>
							<uni-th align="center">规格名称</uni-th>
							<uni-th align="left">库存</uni-th>
							<uni-th align="left">可用</uni-th>
							<uni-th align="left">数量</uni-th>
							<uni-th align="left">单位</uni-th>
							<uni-th align="left">备注</uni-th>
						</uni-tr>
						<!-- 表格数据行 -->
						<uni-tr>
							<uni-td>苹果 iPhone 14 Plus ( PPCP006 )</uni-td>
							<uni-td>PPCP006 ( PPCP006 )</uni-td>
							<uni-td>0</uni-td>
							<uni-td>15</uni-td>
							<uni-td><input type="text" /></uni-td>
							<uni-td>台</uni-td>
							<uni-td><input type="text" /></uni-td>
						</uni-tr>
					</uni-table>
				</view>
			</view>
		</view>
		<u-picker :immediateChange="true" :closeOnClickOverlay="true" :show="show" :columns="wareTypeList" keyName="name" @confirm="confirm"></u-picker>
		<u-picker :immediateChange="true" :closeOnClickOverlay="true" :show="show2" :columns="ckCkList" keyName="nameVal" @confirm="confirm2"></u-picker>
		<view class="footer">
			<button  class="save-btn" @click="commitMoney">审核</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				show2: false,
				show3: false,
				show4: false,
				show5: false,
				show6: false,
				show7: false,
				custAccId: '',
				recordType: '出库',
				statusName: '出库',
				wareTypeList: [],
				ckCkList:[]
			}
		},
		onLoad(e) {
			this.workId = e.workId
			this.id = e.id
			this.custAccId = uni.getStorageSync('custAccid')
			this.acId = uni.getStorageSync('acId')
			
			this.getPersons()
			
			
			
			
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.getPullRefresh()
		},
		methods: {
			// 下拉刷新请求数据
			getPullRefresh(){
				console.clear()
				this.getPersons()
			},
			// 出库审核人员
			async getPersons() {
				const res = await uni.$api.factory.personnel({
					custAccId: this.custAccId,
					recordType: this.recordType,
					statusName: this.statusName
				})
				this.get_emp()
			},
			// 制单人员
			async get_emp() {
				const res = await uni.$api.factory.emps({
					custAccId: this.custAccId,

				})
				this.find_WareType()
			},
			// 出库类型
			async find_WareType() {
				const res = await uni.$api.factory.findWareType({
					custAccId: this.custAccId,
					recordType: this.recordType,
				})
				this.wareTypeList = [res.data]
				this.ck_NetWork()
			},
			// 出库网点
			async ck_NetWork() {
				const res = await uni.$api.factory.ckNetWork({
					custAccId: this.custAccId,
					type: 1
				})
				this.find_ckCk()
			},
			// 出库仓库
			async find_ckCk() {
				const res = await uni.$api.factory.ckNetWork({
					custAccId: this.custAccId,
					type: 0
				})
				this.ckCkList=[res.data]
				uni.stopPullDownRefresh()
			},
			// 选择出库网点
			confirm(e) {
				this.show=false
			},
			// 选择出库仓库
			confirm2(e) {
				this.show2=false
			},
		},

	}
</script>

<style lang="scss">
	/deep/.u-navbar--fixed {
		position: static !important;
	}
	
	.flex-around {
		justify-content: space-around;
	}

	.save-btn {
		background-color: #fd7400;
		color: #fff;
		height: 50px;
		font-size: 16px;
		border-radius: 4rpx;
		line-height: 50px;
	}

	.address-color {
		color: #505050;
	}
	.process {
		min-height: 100vh;
		background-color: #f5f5f5;
		
		.process-content {
			padding: 20rpx;
		}
		
		/deep/.u-radio__icon-wrap {
			width: 48rpx !important;
			height: 48rpx !important;
		}
		
		.top {
			padding: 30rpx 38rpx 28rpx 0;
			padding-left: 32rpx;
			background: $uni-bg-color;
		}
		
		.title {
			font-size: 32rpx;
			font-weight: 600;
		}
		
		.radio {
			flex: 1;
		}
		
		.form {
			background: $uni-bg-color;
			padding: 15px;
			border-radius: 10rpx;
		
			.form-top {
				padding: 30rpx 38rpx 28rpx 0;
				border-bottom: 1px solid #f5f5f5;
			}
		}
		
		.add {
			background-color: #f5f5f5;
			padding: 30rpx 38rpx 28rpx 0;
			padding-left: 32rpx;
		}
		
		.footer {
			padding: 10px;
			background: #fff;
			bottom: 0;
			width: 100%;
			border-top: solid 1px #f2f2f2;
			box-sizing: border-box;
			position: fixed;
			z-index: 100;
			
			.save-btn {
				background-color: #fd7400;
				color: #fff;
				border-radius: 10rpx;
			}
		}
		
		
	}
	
</style>